package com.shigu.wsysnatch.springrun;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 类名：TimerTrigger
 * 类路径：com.shigu.src.com.shigu.com.com.shigu.wsysnatch.springrun.TimerTrigger
 * 创建者：王浩翔
 * 创建时间：2017-09-06 13:23
 * 项目：snatchwebpage
 * 描述：定时执行
 */

@Component("timerTrigger")
public class TimerTrigger {

    @Autowired
    WsySnatch wsySnatch;

    //每半小时执行一次
    @Scheduled(cron = "0 0/30 * * * *")
    public void execute() {
        wsySnatch.snatch();
    }
}
